<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="demo">
			
		</div>
		<script>
		function myDisplayer(f){
			document.getElementById("demo").innerHTML=f;
		}
		async function myFunction(i) {
		  if(i%2==0)
			return "Hello";
		  return Promise.reject("必须要偶数");
		}
		myFunction(452).then(
		  function(value) {myDisplayer(value);},
		  function(error) {myDisplayer("error:"+error);}
		  );
		</script>
	</body>
</html>
